//
//  NetWorkViewModel.swift
//  TCSTARNewWork
//
//  Created by kate on 2023/5/15.
//

import Foundation
import RxSwift

public class NetWorkViewModel: NSObject {
    
    public let disposeBag: DisposeBag = DisposeBag()
    let services: NetWorkService = NetWorkService()
    var sendId: String = "11"
    var receiveId: String = "20"
    var typeId: String = "1"
    var content: String = "22"
    
    public func sendMsg() -> Observable<Any>{
        
        services.sendMsg(sendId: sendId, receiveId: receiveId, typeId: typeId, content: content).map { item in
            print("item = \(item)")
            return item
        }
    }
    
    public func receiveMsg() -> Observable<[ReceiveMsgModel]> {
        
        return services.reveiveMsg(receiveId: receiveId, msgParamList: [["sendId":"11", "lastMsgId": "1"]]).map { items in
            print("sssss")
            print(items)
            return items
        }
    }
}
